//    Copyright (C) Kherty.  All rights reserved.
using System;

namespace OpenLS.Spreadsheet.AnalysisToolPak
{
    internal class Celsius : UnitBase
    {
        public Celsius() : base("C")
        {
        }

        public override double ConvertTo(double value, UnitBase other)
        {
            if (other is Celsius)
                return value;
            if (other is Farenheit)
                return value*1.8 + 32;
            if (other is Kelvin)
                return value + 273.15;
            throw new NotSupportedException();
        }
    }
}